'''
a = "laowang"
b = "hahaha"
c = "==="+a+b+"==="
print(c)
for temp in c:
    print(temp)
print(c[5])
print(len(c))
print(c[-1])
'''
#切片,逆序
'''
ss = "abcdefghijklmnop"
s1 = ss[2:5]
s2 = ss[5:]
s3 = ss[2:-2:2]
s4 = ss[-1::-1]
s5 = ss[::-1]#逆序
print("ss=%s,s1=%s,s2=%s,s3=%s,s4=%s,s5=%s"%(ss,s1,s2,s3,s4,s5))
'''
#常见操作
mystr = "python ha ha hello world ha and different ha kind of the use"
#find找不到返回-1
mystr.find("of")
mystr.rfind("hello")
#index找不到返回异常
mystr.index("and")
mystr.rindex("world")
#count统计个数
mystr.count("hello")
#replace替换
mystr.replace("world","WORLD")
mystr.replace("ha","HA",1)
#split切割,可以统计个数
mystr.split(" ")
#capitalize，第一个字母大写
mystr.capitalize()
#title,把每个单词首字母大写
mystr.title()
#startwith,endwith
name = "chen hai ying"
name.startswith("chen")
name.endswith("ying")
#lower,upper,变大小写
name.lower()
name.upper()
#ljust,rjust,center
lyric = "风筝有风 海豚有海"
print(lyric.center(50))
lyric.ljust(50)
lyric.rjust(50)
#strip,lstrip,rstrip
test = "          风筝有风 海豚有海          "
test.lstrip()
test.rstrip()
test.strip()
#partition,rpartition
mystr.partition("ha")
mystr.rpartition("ha")
#splitlines,按照行分割，返回一个包含各行作为元素的列表
mystr_test = "hello\nworld\nha\nha"
mystr_test.splitlines()
#isalpha,isdigit,isalnum,判断是字母，数字还是混合
#isspace判断纯空格
#join

hh = "hdh \t freoio vbd v\tbsla bnxc\tj \t vbioa \t hg oi gfga df"
result = hh.split()
print("".join(result))











